import java.util.PriorityQueue;
import java.util.*;
class people implements Comparable<people> {


    public int age;
    public String name;

    public people(int age ,String name) {
        this.age = age;
        this.name = name;
    }

    @Override
    public int compareTo(people o) {
        return this.age-o.age;
    }
}
class NameComparator implements Comparator<people>{
    @Override
    public int compare(people o1, people o2) {
        return o1.name.compareTo(o2.name);
    }
}
public class demo {
    public static void main(String[] args) {
        people p1 = new people(10,"zhangsan");
        people p2 = new people (8,"lisi");
        PriorityQueue<people> priorityQueue = new PriorityQueue<>();
        priorityQueue.offer(p1);
        priorityQueue.offer(p2);

    }
    public static void main1(String[] args)
    {
        people p1 = new people(10,"zhangsan");
        people p2 = new people (8,"lisi");
        System.out.println(p1.compareTo(p2));

    }

}
